/***************************************************************************
 *   Copyright (C) 2008 by Tomasz Dubik                                    *
 *   tdubik@gmail.com                                                      *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef SETTINGS_H
#define SETTINGS_H

#include <QSettings>
#include <QString>
#include <QVariant>
namespace SettingsKeys
{
    static const QString AppSettings_FtpHost = QString("ftp/ftphost");
    static const QString AppSettings_FtpUsername = QString("ftp/ftpusername");
    static const QString AppSettings_FtpPassword = QString("ftp/ftppassword");
    static const QString AppSettings_FtpPassive = QString("ftp/ftppassive");
    static const QString AppSettings_FtpSavePassword = QString("ftp/ftpsavepassword");
    static const QString AppSettings_GenEnableSync = QString("general/enablesync");
    
    static const QString UI_WINDOW_SIZE  = QString("mainwindow/size");
    static const QString UI_WINDOW_POS = QString("mainwindow/pos");
    static const QString UI_TREE_1_SIZE = QString("mainwindowtree1/size");
    static const QString UI_TREE_2_SIZE = QString("mainwindowtree2/size");
    static const QString UI_TREE_3_SIZE = QString("mainwindowtree3/size");
    static const QString Xml = QString("xml");
    namespace KeyboardShortcuts
    {
        static const QString scQuitShortCut = QString("shortcut/quit");
    }
};
class Settings
{
    Q_DISABLE_COPY( Settings );
    public:
        ~Settings();
        enum Context
        {
            GENERAL=0,
            UI,
            TREEWIDGET,
            KEYBOARDSHORTCUTS
        };
        /*! 
         * @brief returns value for key 
         */
        static QVariant value ( const QString & _key ) ; 
        static void setValue ( const QString & _key, const QVariant & value) ;
        
        static QString filePath() ; 
        static void sync() ;
    private:
        Settings();
        static Settings * instance() ; 
        QSettings m_Settings ; 
};

#endif // SETTINGS_H
